home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: mvaccaro1@aol.com (MVaccaro1)
- Newsgroups: comp.lang.c
- Subject: Re: Getting output from system(cmd)
- Date: 18 Mar 1996 21:29:08 -0500
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4il65k$bol@newsbf02.news.aol.com>
- References: <4ijccg$r3s@castor.usc.edu>
- Reply-To: mvaccaro1@aol.com (MVaccaro1)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- James,
-
- If your running in DOS you might want to redirecting the command output to
- a file. Then latter in your program, you can open that file and reading
- it in.
-
- I tried the following:
-
- /*
- ** Test of redirection in system command
- */
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <process.h>
-
- int main( void )
- {
- int fStatus;
-
- fStatus = system( "mem > memory.dat" );
- if ( fStatus == -1 )
- printf( "\nFunction failed" );
- return 0;
- }
-
- This runs the mem command and puts the output to disk in a file called
- MEMORY.DAT. I hope this helps you.
-
- Mike :->
-
-
- Design? What design! - I've too much coding to do...
-